package com.lewis;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@SpringBootApplication
@MapperScan(basePackages="com.lewis.mapper")
@EnableTransactionManagement
@EnableCaching
public class BatisApplication extends WebMvcConfigurationSupport {

	public static void main(String[] args) {
		SpringApplication.run(BatisApplication.class, args);
	}
	
	
	/**
	 * 配置swagger2
	 */
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
			
			registry.addResourceHandler("swagger-ui.html")
	        .addResourceLocations("classpath:/META-INF/resources/");
	
	       registry.addResourceHandler("/webjars/**")
	        .addResourceLocations("classpath:/META-INF/resources/webjars/");
	       
	
		}
	
	
}
